Skip to main content

Retrieve historical time-series data for a single metric

POST 

/query/metric/histogram

This endpoint retrieves time-series data for a single specified metric over a given timeline. The data is displayed as a series of data points, each representing a specific moment in time. Users can specify a metric (e.g., system.cpu.percent), the entity type (e.g., monitor), and a list of specific entities. The data can be aggregated using methods such as avg (average) or others based on the user's request. Additionally, the timeline and granularity can be customized, allowing for detailed insights into both current and historical performance metrics.

Request

Body

required
    queries object[]required

    A list of queries to retrieve time-series data for a single metric.

  • Array [
  • aggregator stringrequired

    The method of aggregation for the data points, such as 'avg', 'sum', 'min', 'max', and 'count'

    data.point stringrequired

    The specific metric to query, such as 'system.cpu.percent'. Only one metric can be queried in this endpoint.

    entity.type string

    The type of entity for which data is being retrieved, for example, 'monitor'.

    entities integer[]

    The specific entity IDs to query the data for. The ID could be a Monitor ID, Group ID, or a Tag value based on the 'entity.type' you have selected

  • ]
  • data.filter object

    Used to filter the data based on specific conditions. Multiple groups of filters can be combined using logical operators.

    groups object[]

    Defines groups of conditions for the pre-filter. Each group consists of multiple conditions that can be combined with a logical operator. You can add a maximum of 3 groups at once.

  • Array [
  • conditions object[]

    List of individual conditions within the group. Each condition specifies a field, an operator, and a value. You can add a maximum of 3 conditions at once.

  • Array [
  • operand string

    The field to apply the condition on, such as a metric.

    operator string

    The comparison operator used for filtering. For string values, the possible values are 'in', 'start with', 'end with', '=', and 'contain'. For integer values, the possible values are '=', '>', '>=', '<', '<='

    value string

    The value to compare the operand against.

  • ]
  • filter string

    Defines whether this group is an inclusion or exclusion filter. The possible values are 'include' and 'exclude'.

    operator string

    Logical operator to combine conditions within the group. The possible values are 'and' and 'or'.

  • ]
  • filter string

    Defines whether the overall pre-filter is an inclusion or exclusion filter. The possible values are 'include' and 'exclude'.

    operator string

    Logical operator to combine all groups in the pre-filter. The possible values are 'and' and 'or'.

    result.filter object

    Specifies the post-filters applied to the time-series results. This attribute allows users to refine the output by including or excluding results based on defined conditions.

    conditions object[]

    List of conditions to filter the time-series results. Each condition specifies a field, an operator, and a value. You can add a maximum of 3 conditions at once.

  • Array [
  • operand string

    The field to apply the condition on, such as a metric.

    operator string

    The comparison operator used for filtering. For string values, the possible values are 'in', 'start with', 'end with', '=', and 'contain'. For integer values, the possible values are '=', '>', '>=', '<', '<='

    value integer

    The value to compare the operand against.

  • ]
  • filter string

    Defines whether the post-filter is an inclusion or exclusion filter. The possible values are 'include' and 'exclude'.

    operator string

    Logical operator to combine all conditions in the post-filter. The possible values are 'and' and 'or'.

    timeline objectrequired

    Defines the time range for the data being retrieved. This includes the start and end dates and times.

    from.date daterequired

    The start date for the data retrieval.

    from.time timerequired

    The start time for the data retrieval.

    to.date daterequired

    The end date for the data retrieval.

    to.time timerequired

    The end time for the data retrieval.

    granularity stringrequired

    Defines the granularity (sampling interval) for the data. The granularity field must follow the standard time format, where time intervals are represented as '1 s' for 1 second, '1 m' for 1 minute, '1 h' for 1 hour, '1 d' for 1 day.

    type stringrequired

    Specifies the type of data to be retrieved, such as 'metric'. The possible type of data that can be retrieved are 'metric' and 'availability'.

    result.by string[]

    An array of strings specifying how the results should be grouped, The possible values are 'monitor', 'tag', 'group', and 'instance'.

Responses

Successfully retrieved Historical data with respect to data point with specific aggregator and specific entity type.

Schema
    oneOf
    response-code integer
    status string
    result object[]
  • Array [
  • monitor string
    object.ip string
    id number
    object.id integer
    metric string
    aggregator string
    value integer
    Timestamp number
  • ]
Loading...